<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root">
        <h1>1.moustache语法</h1>
        <h2>{{str}}</h2>

        <h1>v-bind单向绑定</h1>
        <!-- 完整写法v-bind -->
        <input v-bind:value="num">
        <!-- 简写: -->
        <input :value="num">

        <h1>双向绑定</h1>
        <input v-model="num1">
        
        <h1>事件</h1>
        <!-- 完整写法v-on -->
        <button v-on:click="consoleLog">点我</button>
        <!-- 简写@ -->
        <button @click="consoleLog">点我o</button>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        new Vue({
            el: '#root',
            data: {
                str: '假皮沙发',
                num: 123,
                num1: 321
            },
            methods: {
                consoleLog(){
                    console.log('点点点')
                }
            }
        })
    </script>
</body>
</html>